package week2nd;

import java.util.Scanner;
import java.util.StringTokenizer;

public class PP3_8 {//reserve

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String string = scan.nextLine();
        System.out.println(reserve(string));
    }

    public static String reserve(String str) {
        ArrayStack as = new ArrayStack(10);

        StringTokenizer st = new StringTokenizer(str, " ");
        while (st.hasMoreElements()) {
            as.push(st.nextToken());
        }
        String string = "";
        while (!as.isEmpty()) {
            string += as.pop() + " ";
        }

        return string;
    }

}


